package com.wjc.homework;

public class homework06 {
    public static void main(String[] args) {
        Cale cale = new Cale(1,2);
        System.out.println("加"+cale.add());
        System.out.println("减"+cale.minimum());
        System.out.println("乘"+cale.mul());
        System.out.println("除"+cale.div());


    }

}
class Cale{
    private double num1;
    private double num2;



    public Cale(double num1, double num2) {
        this.num1 = num1;
        this.num2 = num2;
    }

    public double getNum2() {
        return num2;
    }

    public double getNum1() {
        return num1;
    }


    public double add(){
        return num1+num2;
    }

    public double minimum(){
        return num1-num2;
    }

    public  double mul(){
        return num1 * num2;
    }
    public  double div(){
        if ( num1 ==0){
            System.out.println("被除数不能为0");
        }
        return num1/num2;
    }



}